package com.ketangpai.admin.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ketangpai.admin.dao.GroupMemberDao;
import com.ketangpai.admin.entity.GroupMember;
import com.ketangpai.admin.service.GroupMemberService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service("groupService")
@Transactional
public class GroupMemberServiceImpl extends ServiceImpl<GroupMemberDao, GroupMember> implements GroupMemberService {
    @Resource
    private GroupMemberDao groupMemberDao;

    /**
     * 获取所有数据
     */
    @Override
    public List<GroupMember> getAll() {
        return groupMemberDao.selectList(null);
    }

    /**
     * 新增数据
     */
    @Override
    public boolean insert(GroupMember groupMember) {
        return groupMemberDao.insert(groupMember)>0;
    }

    /**
     * 修改数据
     */
    @Override
    public boolean update(GroupMember groupMember) {
        return groupMemberDao.updateById(groupMember)>0;
    }

    /**
     * 通过主键删除数据
     */
    @Override
    public boolean deleteById(Integer id) {
        return this.groupMemberDao.deleteById(id) > 0;
    }
}
